<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<hr>
<label><input id="all-cbx" type="checkbox"/> 全选</label>
<label><input id="rev-cbx" type="checkbox"/> 反选</label>
<hr/>
<label><input name="users" type="checkbox"/> 赵四</label>
<label><input name="users" type="checkbox"/> 刘能</label>
<label><input name="users" type="checkbox"/> 广坤</label>
<label><input name="users" type="checkbox"/> 王云</label>
<label><input name="users" type="checkbox"/> 飞机</label>
<body>
<script>


    // 抓取DOM元素
    let users = document.querySelectorAll('input[name="users"]');
    let allCbx = document.querySelector('#all-cbx');
    let revCbx = document.querySelector('#rev-cbx');

    // 点击全选多选框，可以将所有内容选中，再次点击可以取消全选
    allCbx.onclick = () => {
        for (let i = 0, j = users.length; i < j; i++) {
            users[i].checked = allCbx.checked;
        }
    };

    // 点击反选多选框，可以将所有内容反选，再次点击再次反选
    revCbx.onclick = () => {
        for (let i = 0, j = users.length; i < j; i++) {
            users[i].checked = !users[i].checked;
        }
    }

</script>
</body>
</html>